package com.leon.programPeral.ch2.ext1;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class HaveTimeAndSpaceClient
{
	public static List<String> dic = new ArrayList<>();
	public static Map<String, List<String>> mdic = new HashMap<>();

	static
	{
		dic.add("add");
		dic.add("tops");
		dic.add("stop");

		dic.stream().forEach((a) -> {
			String cha = OnlyWordAndDir.cha(a);
			if (!mdic.containsKey(cha))
				mdic.put(cha, new ArrayList<>());
			mdic.get(cha).add(a);
		});
		//		OnlyWordAndDir.cha()
	}

	public static void main(String[] args)
	{
		System.out.println(mdic.get(OnlyWordAndDir.cha("stop")));
		System.out.println(mdic.get(OnlyWordAndDir.cha("stops")));
	}
}

